package com.shamar.blog.dto;

import com.shamar.blog.entity.BlogContent;
import com.shamar.blog.enums.BlogContentStateEnum;

import java.util.List;

/**
 * 封装执行后结果
 */
public class BlogContentExecution {

	// 结果状态
	private int state;

	// 状态标识
	private String stateInfo;

	// 博文数量
	private int count;

	// 操作的博文（修改博文的时候用）
	private BlogContent blogContent;

	// 获取的Content列表(查询博文的时候用)
	private List<BlogContent> blogContentList;

	//空参构造器
	public BlogContentExecution() {
	}

	// 失败的构造器
	public BlogContentExecution(BlogContentStateEnum stateEnum) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
	}

	// 成功的构造器
	public BlogContentExecution(BlogContentStateEnum stateEnum, BlogContent blogContent) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.blogContent = blogContent;
	}

	// 成功的构造器
	public BlogContentExecution(BlogContentStateEnum stateEnum, List<BlogContent> blogContentList) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.blogContentList = blogContentList;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public void setStateInfo(String stateInfo) {
		this.stateInfo = stateInfo;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public BlogContent getBlogContent() {
		return blogContent;
	}

	public void setBlogContent(BlogContent blogContent) {
		this.blogContent = blogContent;
	}

	public List<BlogContent> getBlogContentList() {
		return blogContentList;
	}

	public void setBlogContentList(List<BlogContent> blogContentList) {
		this.blogContentList = blogContentList;
	}
}